GCC = g++
CPPFLAGS = -g -finline-functions -Wall -Winline -pipe -DOS_LINUX -fPIC
HEAD_INFO = -DPROJECT_NAME="\"FASTSEARCH\"" -DDESCRIPTION="\"FastSearch strategy_engine\""


COMMON_PATH=../../../common
PB_PATH=../../../common/protobuf
	  
INCLUDES = -I./ \
		   -I$(COMMON_PATH)/commonlib/output/include \
		   -I$(COMMON_PATH)/plugin_helper/output/include \
		   -I../communication_manager/output/include \
		   -I$(COMMON_PATH)/include \
		   -I$(PB_PATH)/include \
		   -I$(COMMON_PATH)/libxml2/include/ 

LIBS     = -L./ \
		   -L$(COMMON_PATH)/commonlib/output/lib -lcommonlib \
		   -L$(COMMON_PATH)/plugin_helper/output/lib -lplugin_helper \
		   -L../communication_manager/output/lib -lcommunication_manager \
		   $(PB_PATH)/lib/libprotobuf.a \
		   -L$(THIRDPATH)/libxml2/lib/ -lxml2 \
		   -lm -lpthread -lcrypto -ldl

all : libstrategy_engine.a 
	  mkdir -p output/include
	  mkdir -p output/lib
	  cp *.h output/include
	  cp *.a output/lib

libstrategy_engine.a: strategy_engine.o strategy_engine_manager.o strategy_info.o
	$(AR) -crv $@ $^

%.o : %.cpp
	$(GCC) $(CPPFLAGS) $(HEAD_INFO) -c $< -o $@ $(INCLUDES)

clean :
	rm -f *.o
	rm -rf *.a
	rm -rf output

